package mapper;

import model.Patient;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface PatientMapper {
    @Insert("insert into patient (name, birthday, sex, address, phone, id_card, is_medicare, id_medicare)"+
            " values (#{name},#{birthday},#{sex},#{address},#{phone},#{idCard},#{isMedicare},#{idMedicare})")
    int add(Patient patient);

    @Select("select count(*) from patient where id_medicare = #{id}")
    int checkMedicare(String id);

    @Select("select count(*) from patient where id_card = #{id}")
    int checkCard(String id);


}
